<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
  <title>Intro to ASP.NET MVC 3: The Official Microsoft ASP.NET Site</title>
  
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  <link href="http://i2.asp.net/common/www-css/i/favicon.ico?cdn_id=2011-09-16-001" rel="shortcut icon">
  <link href="getting-started-with-mvc3-part1-cs_files/main.css" rel="stylesheet" type="text/css" media="screen">
  <link href="getting-started-with-mvc3-part1-cs_files/titanoverrides.css" rel="stylesheet" type="text/css" media="screen">
  
  <script src="getting-started-with-mvc3-part1-cs_files/jquery-1.js" type="text/javascript"></script>
  <script src="getting-started-with-mvc3-part1-cs_files/msc_all.js" type="text/javascript"></script>  
  
  

</head>
<body>
<form method="post" action="/mvc/tutorials/getting-started-with-mvc3-part1-cs?" id="form1">
<div class="aspNetHidden">
<input name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUENTM4MQ9kFgJmD2QWAmYPZBYCZg9kFgJmD2QWAgIFEGRkFgICDQ9kFgJmD2QWAmYPZBYCZg8WAh4HVmlzaWJsZWdkZKrDY1NG1HjNDVKzlZSX2Dy7poMS" type="hidden">
</div>

<div id="content_container" class="content_container">
<div class="header_container">
    <div class="header_top"><div class="header_top_right">&nbsp;</div></div>
    
    <div class="header_content">
        <div class="header_content_right">
            <a href="http://www.asp.net/" title="Home Page">
                <img class="logo" style="border-width: 0px;" alt="" src="getting-started-with-mvc3-part1-cs_files/logo.png" title="Microsoft ASP.NET">
            </a>
        <div id="WLSearchBoxDiv"><div id="WLSearchBoxPlaceholder"><input class="search_box" id="WLSearchBoxInput" name="WLSearchBoxInput" value="Search"><input class="search_button" id="WLSearchBoxButton" value="" name="WLSearchBoxButton" type="button"></div></div><div id="mainnav"><ul class="nav_main"><li class="first"><a href="http://www.asp.net/home">Home</a></li><li><a href="http://www.asp.net/get-started">Get Started</a></li><li><a href="http://www.asp.net/downloads">Downloads</a></li><li><a href="http://www.asp.net/web-pages">Web Pages</a></li><li><a href="http://www.asp.net/web-forms">Web Forms</a></li><li class="active"><a href="http://www.asp.net/mvc">MVC</a></li><li><a href="http://www.asp.net/community">Community</a></li><li><a href="http://forums.asp.net/">Forums</a></li></ul></div>            
      <div class="nav_login_user"><ul><li class="first"><a href="http://login.asp.net/login/signin.aspx?ReturnUrl=http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part1-cs">Sign In</a></li><li><a href="http://login.asp.net/login/createuser.aspx?ReturnUrl=http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part1-cs">Join</a></li></ul></div>
        </div>
    </div>
    <div class="header_breadcrumb_top">
  <div class="header_breadcrumb_top_right"></div>
</div>
<div class="header_breadcrumb_content">
  <div class="header_breadcrumb_content_right"><span><span><a href="http://www.asp.net/home">Home</a></span><span> › </span><span><a href="http://www.asp.net/mvc">ASP.NET MVC</a></span><span> › </span><span><a href="http://www.asp.net/mvc/tutorials">ASP.NET MVC Tutorials</a></span><span> › </span><span>Intro to ASP.NET MVC 3</span></span></div>
</div>
<div class="header_breadcrumb_bottom">
  <div class="header_breadcrumb_bottom_right"></div>
</div>
</div>

<div class="center top_banner"><iframe src="getting-started-with-mvc3-part1-cs_files/adbanner.htm" marginheight="0" marginwidth="0" frameborder="0" height="90" scrolling="no" width="728">&nbsp;</iframe></div>


  
  <div class="columns_container leftsidebar">
    <div class="columns_left">
      <div class="common-module">
        <h2 class="common-module-header">Learning Resources</h2>
        <div class="common-module-content">
          <ol class="common-toc">
            <li><h3>1.&nbsp;
    Getting Started</h3><ul><li><a href="http://www.asp.net/mvc/mvc3">Installation and Overview</a></li><li>Tutorials </li><ul><li class="active"><a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part1-cs">Your First ASP.NET MVC App</a></li></ul><ul><li><a href="http://www.asp.net/mvc/tutorials/mvc-music-store-part-1">Music Store Tutorial App</a></li></ul><li><a href="http://forums.asp.net/1146.aspx/" class="icon-external-link" target="_blank">ASP.NET MVC Forum</a></li></ul></li><li><h3>2.&nbsp;
    What is MVC?</h3><ul><li><a href="http://msdn.microsoft.com/en-us/library/dd381412%28VS.98%29.aspx" class="icon-external-link" target="_blank">ASP.NET MVC Overview</a></li><li><a href="http://msdn.microsoft.com/en-us/library/dd410120%28VS.98%29.aspx" class="icon-external-link" target="_blank">MVC Project Structure</a></li></ul></li><li><h3>3.&nbsp;
    Controllers and Routing</h3><ul><li>Controllers</li><ul><li><a href="http://msdn.microsoft.com/en-us/library/dd410269%28VS.98%29.aspx" class="icon-external-link" target="_blank">Controller Basics</a></li></ul><ul><li><a href="http://www.asp.net/mvc/tutorials/understanding-models-views-and-controllers-cs">Models, Views, and Controllers</a></li></ul><li>Routing</li><ul><li><a href="http://www.asp.net/mvc/tutorials/asp-net-mvc-routing-overview-cs">ASP.NET MVC Routing Overview</a></li></ul><ul><li><a href="http://msdn.microsoft.com/en-us/library/cc668201.aspx" class="icon-external-link" target="_blank">ASP.NET Routing</a></li></ul><ul><li><a href="http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx" class="icon-external-link" target="_blank">URL Routing</a></li></ul><li>Filtering</li><ul><li><a href="http://msdn.microsoft.com/en-us/library/gg416513%28VS.98%29.aspx" class="icon-external-link" target="_blank">Filtering in ASP.NET MVC</a></li></ul></ul></li><li><h3>4.&nbsp;
    Views</h3><ul><li><a href="http://weblogs.asp.net/scottgu/archive/2010/07/02/introducing-razor.aspx" class="icon-external-link" target="_blank">Introducing Razor</a></li><li><a href="http://www.asp.net/webmatrix/tutorials/2-introduction-to-asp-net-web-programming-using-the-razor-syntax">Programming with Razor Syntax</a></li></ul></li><li><h3>5.&nbsp;
    Models (Data)</h3><ul><li>Using Entity Framework (EF) Code First</li><ul><li><a href="http://www.asp.net/entity-framework/tutorials/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application">Creating an EF Data Model</a></li></ul><ul><li><a href="http://www.asp.net/entity-framework/tutorials/implementing-basic-crud-functionality-with-the-entity-framework-in-asp-net-mvc-application">Basic CRUD Functionality</a></li></ul><ul><li><a href="http://www.asp.net/entity-framework/tutorials/sorting-filtering-and-paging-with-the-entity-framework-in-an-asp-net-mvc-application">Sorting, Filtering, and Paging</a></li></ul><ul><li><a href="http://www.asp.net/entity-framework/tutorials/creating-a-more-complex-data-model-for-an-asp-net-mvc-application">A More Complex Data Model</a></li></ul><ul><li><a href="http://www.asp.net/entity-framework/tutorials/reading-related-data-with-the-entity-framework-in-an-asp-net-mvc-application">Reading Related Data</a></li></ul><ul><li><a href="http://www.asp.net/entity-framework/tutorials/updating-related-data-with-the-entity-framework-in-an-asp-net-mvc-application">Updating Related Data</a></li></ul><ul><li><a href="http://www.asp.net/entity-framework/tutorials/handling-concurrency-with-the-entity-framework-in-an-asp-net-mvc-application">Handling Concurrency</a></li></ul><ul><li><a href="http://www.asp.net/entity-framework/tutorials/implementing-inheritance-with-the-entity-framework-in-an-asp-net-mvc-application">Implementing Inheritance</a></li></ul><ul><li><a href="http://www.asp.net/entity-framework/tutorials/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application">Repository &amp; Unit of Work Patterns</a></li></ul><ul><li><a href="http://www.asp.net/entity-framework/tutorials/advanced-entity-framework-scenarios-for-an-mvc-web-application">Advanced Scenarios</a></li></ul><li>Using EF Database First</li><ul><li><a href="http://www.asp.net/mvc/tutorials/creating-model-classes-with-the-entity-framework-cs">Creating Model Classes</a></li></ul><li>Implementing the Repository Pattern for TDD</li><ul><li><a href="http://msdn.microsoft.com/en-us/library/gg416511%28VS.98%29.aspx" class="icon-external-link" target="_blank">Using TDD</a></li></ul><li>Common Validation Scenarios</li><ul><li><a href="http://msdn.microsoft.com/en-us/library/ee256141%28VS.98%29.aspx" class="icon-external-link" target="_blank">Validating Data Using Attributes</a></li></ul><ul><li><a href="http://msdn.microsoft.com/en-us/library/gg508808%28VS.98%29.aspx" class="icon-external-link" target="_blank">Implementing Remote Validation</a></li></ul><li><a href="http://msdn.microsoft.com/en-us/data/ef" class="icon-external-link" target="_blank">ADO.NET Entity Framework</a></li></ul></li><li><h3>6.&nbsp;
    JavaScript</h3><ul><li>Using jQuery</li><ul><li><a href="http://www.asp.net/mvc/tutorials/creating-a-mvc-3-application-with-razor-and-unobtrusive-javascript">Unobtrusive JavaScript</a></li></ul><ul><li><a href="http://bradwilson.typepad.com/blog/2010/10/mvc3-unobtrusive-validation.html" class="icon-external-link" target="_blank">Unobtrusive Client Validation</a></li></ul><li><a href="http://bradwilson.typepad.com/blog/2010/10/mvc3-unobtrusive-ajax.html" class="icon-external-link" target="_blank">Unobtrusive Ajax in ASP.NET MVC 3</a></li><li><a href="http://haacked.com/archive/2010/04/15/sending-json-to-an-asp-net-mvc-action-method-argument.aspx" class="icon-external-link" target="_blank">Sending JSON to an Action Method</a></li><li><a href="http://msdn.microsoft.com/en-us/library/dd381533%28VS.98%29.aspx" class="icon-external-link" target="_blank">Adding Ajax to ASP.NET MVC</a></li><li><a href="http://www.asp.net/mvc/tutorials/iteration-7-add-ajax-functionality-cs">Adding Ajax to a Contacts Application</a></li><li><a href="http://www.asp.net/ajaxlibrary/cdn.ashx#ASPNET_MVC_Releases_on_the_CDN_7">Microsoft Ajax CDN</a></li></ul></li><li><h3>7.&nbsp;
    Security</h3><ul><li><a href="http://msdn.microsoft.com/en-us/library/gg703322%28VS.98%29.aspx" class="icon-external-link" target="_blank">Creating an Intranet Site</a></li><li><a href="http://msdn.microsoft.com/en-us/library/ff398049%28VS.98%29.aspx" class="icon-external-link" target="_blank">Using Forms Authentication</a></li></ul></li><li><h3>8.&nbsp;
    Internationalization</h3><ul><li><a href="http://afana.me/post/aspnet-mvc-internationalization.aspx" class="icon-external-link" target="_blank">Internationalization and Globalization</a></li><li><a href="http://msdn.microsoft.com/en-us/library/gg674880%28VS.98%29.aspx" class="icon-external-link" target="_blank">Validation for Non-English Locales</a></li></ul></li><li><h3>9.&nbsp;
    Dependency Injection</h3><ul><li><a href="http://haacked.com/archive/2007/12/07/tdd-and-dependency-injection-with-asp.net-mvc.aspx" class="icon-external-link" target="_blank">TDD and Dependency Injection</a></li><li><a href="http://bradwilson.typepad.com/blog/2010/07/service-location-pt1-introduction.html" class="icon-external-link" target="_blank">ASP.NET MVC 3 Service Location</a></li></ul></li><li><h3>10.&nbsp;
    Unit Testing</h3><ul><li><a href="http://msdn.microsoft.com/en-us/library/gg416511%28VS.98%29.aspx" class="icon-external-link" target="_blank">TDD with ASP.NET MVC</a></li><li><a href="http://msdn.microsoft.com/en-us/magazine/dd942838.aspx" class="icon-external-link" target="_blank">Building Testable Applications</a></li><li><a href="http://msdn.microsoft.com/en-us/magazine/dd882516.aspx" class="icon-external-link" target="_blank">Mocks and Tests for Role-Based Objects</a></li></ul></li><li><h3>11.&nbsp;
    Deployment</h3><ul><li><a href="http://msdn.microsoft.com/en-us/library/bb386521.aspx" class="icon-external-link" target="_blank">ASP.NET Deployment Content Map (see Web application projects)</a></li><li><a href="http://blogs.msdn.com/b/rickandy/archive/2011/03/14/enabling-iis-7-x-on-windows-7-vista-sp1-windows-2008-windows-2008-r2.aspx" class="icon-external-link" target="_blank">Enabling IIS 7.x</a></li><li><a href="http://msdn.microsoft.com/en-us/library/dd394698.aspx" class="icon-external-link" target="_blank">Web Application Projects Deployment</a></li></ul></li><li><h3>12.&nbsp;
    NuGet (Packages)</h3><ul><li><a href="http://nuget.codeplex.com/documentation?title=Getting%20Started" class="icon-external-link" target="_blank">NuGet Overview</a></li><li><a href="http://docs.nuget.org/docs/start-here/using-the-add-library-package-reference-dialog-box" class="icon-external-link" target="_blank">Installing a Package in Visual Studio</a></li><li><a href="http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package" class="icon-external-link" target="_blank">Creating a Package</a></li></ul></li>
          </ol>
        </div>
      </div>
      <iframe style="border: medium none; margin: 0pt;" src="getting-started-with-mvc3-part1-cs_files/adchain.htm" frameborder="0" height="283" scrolling="no" width="300"></iframe>
    </div><!-- end columns left -->
    
    <div class="columns_right">
      <div class="columns_right_padding">
        
        <div class="common-module"><h1 class="common-module-header">Getting Started With MVC3</h1><div class="common-module-content nav-tertiary"><p>
            (<a id="mscTutorialSideBarSwitchLang" href="#" onclick="swapTutorialSidebarLanguage();return false;">Switch to Visual Basic tutorials</a>)
          </p><div id="mscTutorialSidebarVb" style="display:none"><ul><li><a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part1-vb">Intro to ASP.NET MVC 3</a></li><li><a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part2-vb">Adding a Controller</a></li><li><a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part3-vb">Adding a View</a></li><li><a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part4-vb">Adding a Model</a></li><li><a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part5-vb">Accessing your Model's Data from a Controller</a></li></ul><ul><li><a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part6-vb">Examining the Edit Methods and Edit View</a></li><li><a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part7-vb">Adding a New Field to the Movie Model and Database Table</a></li><li><a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part8-vb">Adding Validation to the Model</a></li><li><a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part9-vb">Improving the Details and Delete Methods</a></li></ul></div><div id="mscTutorialSidebarCs"><ul><li class="active"><a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part1-cs">Intro to ASP.NET MVC 3</a></li><li><a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part2-cs">Adding a Controller</a></li><li><a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part3-cs">Adding a View</a></li><li><a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part4-cs">Adding a Model</a></li><li><a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part5-cs">Accessing your Model's Data from a Controller</a></li></ul><ul><li><a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part6-cs">Examining the Edit Methods and Edit View</a></li><li><a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part7-cs">Adding a New Field to the Movie Model and Table</a></li><li><a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part8-cs">Adding Validation to the Model</a></li><li><a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part9-cs">Improving the Details and Delete Methods</a></li></ul></div><div class="clear">&nbsp;</div></div></div><script type="text/javascript">
      function swapTutorialSidebarLanguage() {
      $("#mscTutorialSidebarVb").toggle();
      $("#mscTutorialSidebarCs").toggle();
      if ($("#mscTutorialSidebarCs").is(":visible")) {
      $("#mscTutorialSideBarTitle").html("Getting Started With MVC3");
      $("#mscTutorialSideBarSwitchLang").html("Switch to Visual Basic tutorials");
      }
      else {
      $("#mscTutorialSideBarTitle").html("Getting Started With MVC3");
      $("#mscTutorialSideBarSwitchLang").html("Switch to Visual C# tutorials");
      }
      }

      </script>
        
        <div class="common-module alt">
          <h2 class="common-module-header">
            Intro to ASP.NET MVC 3
          </h2>  
          <div class="common-module-content">
            <p>This is the <strong>C#</strong> tutorial
	  
                (<a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part1-vb">Switch to the Visual Basic tutorial</a>) 
              </p>
            <p>This tutorial will teach you the basics of building an 
ASP.NET MVC Web application using Microsoft Visual Web Developer 2010 
Express Service Pack 1, which is a free version of Microsoft Visual 
Studio. Before you start, make sure you've installed the prerequisites 
listed below. You can install all of them by clicking the following 
link: <a href="http://www.microsoft.com/web/gallery/install.aspx?appid=VWD2010SP1Pack">Web Platform Installer</a>. Alternatively, you can individually install the prerequisites using the following links:</p>
<ul>
<li><a href="http://www.microsoft.com/web/gallery/install.aspx?appid=VWD2010SP1Pack">Visual Studio Web Developer Express SP1 prerequisites</a> </li>
<li><a href="http://www.microsoft.com/web/gallery/install.aspx?appsxml=&amp;appid=MVC3">ASP.NET MVC 3 Tools Update</a> </li>
<li><a href="http://www.microsoft.com/web/gallery/install.aspx?appid=SQLCE;SQLCEVSTools_4_0">SQL Server Compact 4.0 </a>(runtime + tools support) </li>
</ul>
<p>If you're using Visual Studio 2010 instead of Visual Web Developer 
2010, install the prerequisites by clicking the following link: <a href="http://www.microsoft.com/web/gallery/install.aspx?appsxml=&amp;appid=VS2010SP1Pack">Visual Studio 2010 prerequisites</a>. </p>
<p>A Visual Web Developer project with C# source code is available to accompany this topic. <a href="http://code.msdn.microsoft.com/Introduction-to-MVC-3-10d1b098">Download the C# version</a>. If you prefer Visual Basic, switch to the <a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part1-vb" target="_blank">Visual Basic version</a> of this tutorial.</p>
            
            <div class="pagination"><span class="light">« Previous Tutorial </span><span class="light"> | </span><a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part2-cs"> Next Tutorial »</a></div>
          </div>
        </div>
        
        <div>     
          <h3>What You'll Build</h3>
<p>You'll implement a simple movie-listing application that supports 
creating, editing, and listing movies from a database. Below are two 
screenshots of the application you’ll build. It includes a page that 
displays a list of movies from a database:</p>
<p><a href="file:///C:/Users/riande/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles4C0AB2CA/MoviesWithVariousSm3.png"><img src="getting-started-with-mvc3-part1-cs_files/WindowsLiveWriter_IntrotoASP_002.png" alt="MoviesWithVariousSm"></a></p>
<p>The application also lets you add, edit, and delete movies, as well 
as see details about individual ones. All data-entry scenarios include 
validation to ensure that the data stored in the database is correct.</p>
<p><img src="getting-started-with-mvc3-part1-cs_files/WindowsLiveWriter_IntrotoASP.png"></p>
<h3>Skills You'll Learn</h3>
<p>Here's what you'll learn: </p>
<ul>
<li>How to create a new ASP.NET MVC project. </li>
<li>How to create ASP.NET MVC controllers and views. </li>
<li>How to create a new database using the Entity Framework Code First paradigm. </li>
<li>How to retrieve and display data. </li>
<li>How to edit data and enable data validation. </li>
</ul>
<h3>Getting Started</h3>
<p>Start by running Visual Web Developer 2010 Express ("Visual Web Developer" for short) and select <strong>New Project</strong> from the <strong>Start</strong> page.</p>
<p>Visual Web Developer is an IDE, or integrated development 
environment. Just like you use Microsoft Word to write documents, you'll
 use an IDE to create applications. In Visual Web Developer there's a 
toolbar along the top showing various options available to you. There's 
also a menu that provides another way to perform tasks in the IDE. (For 
example, instead of selecting <strong>New Project</strong> from the <strong>Start</strong> page, you can use the menu and select <strong>File</strong> &gt; <strong>New Project</strong>.)</p>
<p><a href="http://i3.asp.net/common/www-css/i//MVC3/MVC3_gettingStarted_CS/img/VWD.PNG"><img src="getting-started-with-mvc3-part1-cs_files/VWDsm.PNG"></a></p>
<h3>Creating Your First Application</h3>
<p>You can create applications using either Visual Basic or Visual C# as
 the programming language. Select Visual C# on the left and then select <strong>ASP.NET MVC 3 Web Application</strong>. Name your project "MvcMovie" and then click <strong>OK</strong>. (If you prefer Visual Basic, switch to the <a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part1-vb" target="_blank">Visual Basic version</a> of this tutorial.)</p>
<p><img src="getting-started-with-mvc3-part1-cs_files/NewProjectSm.PNG"></p>
<p>In the <strong>New ASP.NET MVC 3 Project</strong> dialog box, select <strong>Internet Application</strong>. Check <strong>Use HTML5 markup</strong> and leave <strong>Razor</strong> as the default view engine.</p>
<p><img src="getting-started-with-mvc3-part1-cs_files/WindowsLiveWriter_IntrotoASP_003.png" height="480" width="530"></p>
<p>Click <strong>OK</strong>. Visual Web Developer used a default 
template for the ASP.NET MVC project you just created, so you have a 
working application right now without doing anything! This is a simple 
"Hello World!" project, and it's a good place to start your application.</p>
<p><a href="http://i3.asp.net/common/www-css/i//MVC3/MVC3_gettingStarted_CS/img/VisualStudioMvcMovie.png"><img src="getting-started-with-mvc3-part1-cs_files/VisualStudioMvcMovieSm.PNG" class="auto-style1"></a></p>
<p>From the <strong>Debug</strong> menu, select <strong>Start Debugging</strong>.</p>
<p><img src="getting-started-with-mvc3-part1-cs_files/StartWithoutDebug.png"></p>
<p>Notice that the keyboard shortcut to start debugging is F5.</p>
<p>F5 causes Visual Web Developer to start a development web server and 
run your web application. Visual Web Developer then launches a browser 
and opens the application's home page. Notice that the address bar of 
the browser says <code>localhost</code> and not something like <code>example.com</code>. That's because <code>localhost</code>
 always points to your own local computer, which in this case is running
 the application you just built. When Visual Web Developer runs a web 
project, a random port is used for the web server. In the image below, 
the random port number is 43246. When you run the application, you'll 
probably see a different port number.</p>
<p><img src="getting-started-with-mvc3-part1-cs_files/YourProjectWillHave.PNG"></p>
<p>Right out of the box this default template gives you two pages to 
visit and a basic login page. The next step is to change how this 
application works and learn a little bit about ASP.NET MVC in the 
process. Close your browser and let's change some code.</p>
        </div>
        
        <div>
          <div class="pagination"><span class="light">« Previous Tutorial </span><span class="light"> | </span><a href="http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part2-cs"> Next Tutorial »</a></div>
          <div class="heading_container"><div class="heading_right_top">&nbsp;</div><h1>Comments (<span id="spanCommentCount">38</span>)</h1><a class="icon_rss_header" target="_blank" href="http://www.asp.net/rss/comments/29549">&nbsp;</a></div><div class="bucket_container"><div class="bucket_top"><span>&nbsp;</span></div><div class="bucket_content region_absminheight"><div><table cellpadding="5" cellspacing="0" width="100%"><tbody id="mscCommentOutput"><tr><td class="icon_contract"><a href="#" onclick="initComments();return false;"><strong>Show all 38 comments</strong></a></td></tr></tbody></table></div><div><p style="padding-left: 10px;">You must be logged in to leave a comment.&nbsp;<a href="http://login.asp.net/login/signin.aspx?ReturnUrl=http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part1-cs">Click here</a> to log in.</p></div></div><div class="bucket_bottom"><span>&nbsp;</span></div></div><script type="text/javascript"> 
  var umbCurrentNodeId = 29549;
  function initComments() {
	BindTemplateData("mscCommentTemplate","mscCommentOutput",
	    "/base/MscComment/GetCommentsForDocument/29549", "initCommentsCallback");
	$("#txtNewComment").val("");
  }
  function initCommentsCallback(json){
	if( json != null ) { $("#spanCommentCount").html(json.length); }
  }
  function submitComment() {
    var url = "/base/MscComment/CreateComment/" + umbCurrentNodeId + ""; 
    var comment = $("#txtNewComment").val();
    if (comment != "") {
      $("#pCommentError").html("");
      jQuery.post(url, { comment: $("#txtNewComment").val() }, function(data) { initComments(); });
    }
    else { 
	$("#pCommentError").html("Comment is empty. Please enter comment and try submitting again.");
    }
  }

</script>  
        </div>
        <div class="clear"></div>
      </div><!--end columns right padding-->
    </div><!--end columns right-->
  </div><!--end columns container-->

    <div style="clear:both">&nbsp;</div>
    <div class="center bottom_banner"><iframe src="getting-started-with-mvc3-part1-cs_files/adbanner_002.htm" marginheight="0" marginwidth="0" frameborder="0" height="90" scrolling="no" width="728">&nbsp;</iframe>&nbsp;</div>
    <div class="footer_container"> 
        <div class="footer_content">
        <p class="footer_links">
            <a href="http://www.asp.net/feedback/">Contact</a> | 
            <a href="http://www.neudesicmediagroup.com/Advertising.aspx?site=ASP">Advertise</a> 
          <br>
            <a href="http://www.asp.net/Terms-Of-Use">Terms of Use</a> | 
            <a href="http://www.microsoft.com/library/toolbar/3.0/trademarks/en-us.mspx">Trademarks</a> | 
          <a href="http://www.asp.net/privacy/">Privacy Statement</a><br>
            © 2011 Microsoft Corporation. All Rights Reserved.
        </p>
        <ul class="footer_site_logos">
      <li class="footer_site_logos"><a href="http://msdn.microsoft.com/" class="footer_site_logos logo-footer-msdn"></a></li>           
            <li class="footer_site_logos"><a href="http://www.silverlight.net/" class="footer_site_logos logo-footer-silverlight"></a></li>
            <li class="footer_site_logos"><a href="http://channel9.msdn.com/" class="footer_site_logos logo-footer-ch9"></a></li>
            <li class="footer_site_logos"><a href="http://www.iis.net/" class="footer_site_logos logo-footer-iis"></a></li>
            <li class="footer_site_logos"><a href="http://visitmix.com/" class="footer_site_logos logo-footer-mix"></a></li>
            <li class="footer_site_logos"><a href="http://windowsclient.net/" class="footer_site_logos logo-footer-wc"></a></li>
        </ul>
      </div>
    </div>
</div>

                    <noscript><a href="http://www.omniture.com" title="Web Analytics"><img
                    src="http://msstonojsaspnet.112.2O7.net/b/ss/msstonojsaspnet/1/H.20.2--NS/0"
                    height="1" width="1" border="0" alt="" /></a></noscript>
<div style="position: absolute; display: none;" id="mscTooltip">
  <div></div>
</div>               

  
    <script id="mscCommentTemplate" type="text/html">
        <# 
            for(var i=0; i < obj.length && obj[i] != null; i++)
            {
                var item = obj[i];             
        #>
        <tr>
            <td valign="top" style="border-top: 1px solid black;width:105px;"><img style="border-width: 0px;" alt="<#= item.username #>" src="<#= item.avatar #>" /></td>
            <td width="100%" valign="top" align="left" style="border-top: 1px solid black;">
                <table style="table-layout:fixed;">
                <tr>
                    <# if( item.time.Hours > 0 || item.time.Minutes > 0 || item.time.Seconds > 0 ) { #>
                        <p>Posted at <a href="javascript:SetPlayerTime('<#= item.time.Hours #>:<#= item.time.Minutes #>:<#= item.time.Seconds #>');"><#= ( item.time.Hours > 0 ) ? item.time.Hours + ":" : ""#><#= item.time.Minutes #>:<#= item.time.Seconds #></a> in the video</p>
                    <# } #>
                    <td style="padding-bottom: 5px;width:500px;">
                        <a href="http://forums.asp.net/members/<#= item.username#>.aspx"><#= item.username #></a> : <font style="font-style: italic;">On <span><#= item.created #></span> said: </font>
                    </td>
                </tr>
                <tr>
                    <td><div style="word-wrap:break-word;width:515px;"><#= item.comment #></div></td>
                </tr>
                </table>
            </td>
        </tr>
        <#
            }
        #>  
    </script>



  <link href="getting-started-with-mvc3-part1-cs_files/shCore.css" rel="stylesheet" type="text/css" media="screen">
  <link href="getting-started-with-mvc3-part1-cs_files/shThemeDefault.css" rel="stylesheet" type="text/css" media="screen">
  <script type="text/javascript" src="getting-started-with-mvc3-part1-cs_files/shComposite.js"></script>
  <script type="text/javascript">SyntaxHighlighter.defaults['gutter'] = false; SyntaxHighlighter.defaults['toolbar'] = true; SyntaxHighlighter.all();</script>
  <script type="text/javascript">function initTutorialTooltip(){$("div.syntaxhighlighter").mouseover(function(){ShowMscTooltip(this, 'To preserve the line breaks in a code block, place your mouse pointer within the block and double-click to select the block before you copy it.');});$("div.syntaxhighlighter").mouseout(function(){HideMscTooltip();});}window.setTimeout(initTutorialTooltip,2000);</script>
  
  <link href="getting-started-with-mvc3-part1-cs_files/prettify.css" rel="stylesheet" type="text/css" media="screen">
  <script type="text/javascript" src="getting-started-with-mvc3-part1-cs_files/prettify.js"></script>
  <script type="text/javascript">$(document).ready(function(){if($("[class='prettyprint']")!= null){prettyPrint();}});</script>

</form>


</body></html>